<?php

// uncomment the following to define a path alias

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Triola Alapítvány',
   'language'=>'hu',

   'defaultController'=>'off', /* page */

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	   'application.components.widgets.*',
	   'ext.galleryManager.*',
	   'ext.galleryManager.models.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool

		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'gii',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),



	),

   'controllerMap'=>array(
      'gallery'=>array(
                    'class'=>'ext.galleryManager.GalleryController',
                    'pageTitle'=>'Gallery administration',
                ),
    ),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),

		'mailer' => array(
		        'class' => 'application.extensions.mailer.EMailer',
		        'pathViews' => 'application.views.email',
		        'pathLayouts' => 'application.views.email.layouts'
		),

		'urlManager'=>array(
			'urlFormat'=>'path',
         'showScriptName' => true,
			'rules'=>array(
			   //'admin/<controller:\w+>' => '<controller>/admin',
			   '<id:\d+>-<title:\w+>'=>'page/view',
			   'trombita-mesterkurzus' => 'registration/create',
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),

		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=triola',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
			'enableProfiling' => true,
			'enableParamLogging' => true
		),

		'request' => array(
		        'class' => 'HttpRequest',
		        'enableCsrfValidation' => true,
		),

		'image'=>array(
		        'class'=>'application.extensions.image.CImageComponent',
		),

		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute',
                    'ipFilters'=>array('127.0.0.1','::1'),
                ),
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'trace, info, error',
                    'categories'=>'system.*',
                ),
               /* array(
                    'class'=>'CEmailLogRoute',
                    'levels'=>'error, warning',
                    'emails'=>'webmaster@triolaalapitvany.hu',
                ),*/
            ),
        ),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
	   'contactMail'=>'triola@triolaalapitvany.hu',
		'registraionEmail'=>'mail@triolaalapitvany.hu',
		'adminEmail'=>'mail@triolaalapitvany.hu',
		   'registrationActive'=>false,

	),
);